#pragma once
#include<iostream>
#include "damiao.h"
#include "SerialPort.h"
namespace DM_motor {
	/**
	 * .@brief MotorFactorErrorCode 电机控制工厂错误码
	 * @see please refer to the documentation
	*/
	enum DM_Code {
		DM_OK,
		DM_Error,
		DM_Serial_Error,
	};

	struct DM_Status
	{
		bool DM_Init;
		bool DM_Running;
		bool DM_Enable;

	};

	/**
	* 驱动电机功能菜单
	* 测试电机功能接口
	*/
	class functionMenu 
	{
	public:
		functionMenu();
		~functionMenu();
		void testMotor();
		DM_Code Init(std::string port);
		DM_Code MotorRun_PV(Motor m,float pos,float vel);

	private:
		std::shared_ptr<SerialPort> serial;
		Motor_Control dm;
	};
}

